const t = require('../../util/token')
const jwt = require('koa-jwt')
function load(app) {
  const token_escape = ['/favicon.ico','/User/MpLogin','/User/UserLogin']
  app.use(
    jwt({
        secret: t.secret_key,
        debug: true
    })
    .unless({ path: token_escape })
  )

  const userRouter = require('../services/user/ARL')
  app.use(userRouter.routes()).use(userRouter.allowedMethods());

  const markRouter = require('../services/mark/ARL')
  app.use(markRouter.routes()).use(markRouter.allowedMethods());
}
module.exports = {
  load
}